package fu.k4c.vTeam;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import fu.k4c.vTeam.Login.LoginActivity;
import fu.k4c.vTeam.Main.MainActivity;

public class HomeActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		overridePendingTransition(android.R.anim.fade_in,
				android.R.anim.fade_out);

		setContentView(R.layout.home_activity);
		Button btn_close = (Button) findViewById(R.id.btn_close);
		Button btn_introduce = (Button) findViewById(R.id.btn_introduce);
		Button btn_login = (Button) findViewById(R.id.btn_login);
		Button btn_skip = (Button) findViewById(R.id.btn_skip);
		btn_skip.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i = new Intent(HomeActivity.this, MainActivity.class);
				i.putExtra("status", "False");
				i.putExtra("email", "");
				i.putExtra("fullName", "");
				startActivity(i);
			}
		});
		btn_login.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i = new Intent(HomeActivity.this, LoginActivity.class);
				startActivity(i);
			}
		});

		btn_close.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				new AlertDialog.Builder(HomeActivity.this)
						.setMessage("Bạn muốn thoát chương trình?")
						.setPositiveButton("Có",
								new DialogInterface.OnClickListener() {
									public void onClick(DialogInterface dialog,
											int whichButton) {

										finish();
									}
								})
						.setNegativeButton("Không",
								new DialogInterface.OnClickListener() {
									public void onClick(DialogInterface dialog,
											int whichButton) {
									}
								}).create().show();
			}
		});

		btn_introduce.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i = new Intent(HomeActivity.this,
						IntroduceActivity.class);
				startActivity(i);
			}
		});
	}

}
